﻿using DingTalk.Corp.Configurations;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DingTalk.Corp.Models
{
    /// <summary>
    /// 
    /// </summary>
    public class DingTalkAgentCollection : KeyedCollection<string, DingTalkAgent>, IDingTalkAgentCollection
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="item"></param>
        /// <returns></returns>
        protected override string GetKeyForItem(DingTalkAgent item)
        {
            return item.Name;
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        IDingTalkAgent IDingTalkAgentCollection.this[string name] => this[name];
        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        IEnumerator<IDingTalkAgent> IEnumerable<IDingTalkAgent>.GetEnumerator()
        {
            return this.GetEnumerator();
        }
    }
}
